home *** CD-ROM | disk | FTP | other *** search
- Path: news.mindlink.net!news
- From: genew@mindlink.bc.ca (Gene Wirchenko)
- Newsgroups: comp.lang.c
- Subject: Re: strings
- Date: Sun, 28 Jan 1996 18:51:11 GMT
- Organization: MIND LINK! - British Columbia, Canada
- Message-ID: <4egglq$d3g@fountain.mindlink.net>
- References: <4eg9qj$1ut4@sp115.ocs.lsu.edu>
- NNTP-Posting-Host: line179.nwm.mindlink.net
- X-Newsreader: Forte Free Agent 1.0.82
-
- eenaya@unix1.sncc.lsu.edu (Pradeep Nayar) wrote:
-
- >Hi,
- >I saw this piece of code in a book somewhere.
-
- >----
- >char *str ;
-
- >str = "hello world"[10] ;
-
- >_________
-
- >what does the second line do?
-
- It condemns the programmer's soul to the Hell of obfuscated code
- <G>.
-
- "hello world" is a pointer. [10] indexes 10 chars past "h" (the
- start): to the "d".
-
- In plain language:
-
- char str;
- str='d';
-
- >Pradeep Nayar
-
- Sincerely,
-
- Gene Wirchenko
-
- C Pronunciation Guide:
- y=x++; "wye equals ex plus plus semicolon"
- x=x++; "ex equals ex doublecross semicolon"
-
-